package com.ybear.citypickerview;

import android.graphics.Typeface;
import android.util.TypedValue;
import android.view.Gravity;

import java.util.Arrays;

public class TextStyleBuild {
    private int textSizeUnit = TypedValue.COMPLEX_UNIT_SP;
    private float textSize = 14;
    private int textColor = 0;
    private int backgroundResource = 0;
    private Typeface typeface = null;
    private int gravity = Gravity.NO_GRAVITY;
    private int[] padding = null;

    @Override
    public String toString() {
        return "TextStyleBuild{" +
                "textSizeUnit=" + textSizeUnit +
                ", textSize=" + textSize +
                ", textColor=" + textColor +
                ", backgroundResource=" + backgroundResource +
                ", typeface=" + typeface +
                ", gravity=" + gravity +
                ", padding=" + Arrays.toString(padding) +
                '}';
    }

    public int getTextSizeUnit() {
        return textSizeUnit;
    }

    public TextStyleBuild setTextSizeUnit(int textSizeUnit) {
        this.textSizeUnit = textSizeUnit;
        return this;
    }

    public float getTextSize() {
        return textSize;
    }

    public TextStyleBuild setTextSize(float textSize) {
        this.textSize = textSize;
        return this;
    }

    public int getTextColor() {
        return textColor;
    }

    public TextStyleBuild setTextColor(int textColor) {
        this.textColor = textColor;
        return this;
    }

    public int getBackgroundResource() {
        return backgroundResource;
    }

    public TextStyleBuild setBackgroundResource(int backgroundResource) {
        this.backgroundResource = backgroundResource;
        return this;
    }

    public Typeface getTypeface() {
        return typeface;
    }

    public TextStyleBuild setTypeface(Typeface typeface) {
        this.typeface = typeface;
        return this;
    }

    public int getGravity() {
        return gravity;
    }

    public TextStyleBuild setGravity(int gravity) {
        this.gravity = gravity;
        return this;
    }

    public int[] getPadding() {
        return padding;
    }

    public TextStyleBuild setPadding(int left, int top, int right, int bottom) {
        this.padding = new int[] { left, top, right, bottom };
        return this;
    }
}
